<template>
	<view class="optiopns">
		<view class="o1">
			<input type="text" placeholder="请输入标题" v-model="title"/>
		</view>
		<view class="o2">
			<textarea placeholder="请输入内容" v-model="content"></textarea>
		</view>
		<u-button type="primary" text="提交" style="width: 100px;" @click="options"></u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				content:''
			}
		},
		methods: {
			options(){
				if(this.title===''||this.content===''){
					uni.showToast({
						title:'参数错误',
						icon:'error'
					})
				}else{
					const op={
						content:this.content,
						title:this.title
					}
					this.api.get('/prod-api/api/common/feedback','POST',op).then(res=>{
						if(res.data.code===200){
							setTimeout(function(){
								uni.showToast({
									title:'反馈成功'
								})
							},700)
						}else{
							setTimeout(function(){
								uni.showToast({
									title:'反馈失败',
									icon:'error'
								})
							},700)
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.o1{
		input{
			margin-bottom: 10px;
		}
		width: 120px;
		border-bottom: 7px solid #ccc; 
	}
	.o2{
		width: 300px;
		height: 150px;
		border: 5px solid #ccc;
		margin: 25px auto;
	}
</style>
